package com.mdd.admin.validate.order;

import com.mdd.admin.validate.BaseParam;
import com.mdd.common.validator.annotation.IDMust;
import com.mdd.common.validator.annotation.IntegerContains;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Length;

import lombok.Data;
import javax.validation.constraints.*;
import java.math.BigDecimal;

/**
 * 订单参数
 * @author panweiliang
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class OrderParam extends BaseParam {

    @IDMust(message = "id参数必传且需大于0", groups = {update.class, delete.class, change.class})
    private Integer id;

    @NotNull(message = "sn参数缺失", groups = {create.class, update.class})
    @Length(max = 64, message = "sn参数不能超出64个字符", groups = {create.class, update.class})
    private String sn;

    @NotNull(message = "transactionId参数缺失", groups = {create.class, update.class})
    @Length(max = 128, message = "transactionId参数不能超出128个字符", groups = {create.class, update.class})
    private String transactionId;

    @NotNull(message = "userId参数缺失", groups = {create.class, update.class})
    @DecimalMin(value = "0", message = "userId参数值不能少于0", groups = {create.class, update.class})
    private Integer userId;

    @NotNull(message = "orderTerminal参数缺失", groups = {create.class, update.class})
    @DecimalMin(value = "0", message = "orderTerminal参数值不能少于0", groups = {create.class, update.class})
    private Integer orderTerminal;

    @NotNull(message = "orderStatus参数缺失", groups = {create.class, update.class})
    @DecimalMin(value = "0", message = "orderStatus参数值不能少于0", groups = {create.class, update.class})
    private Integer orderStatus;

    @NotNull(message = "payStatus参数缺失", groups = {create.class, update.class})
    @DecimalMin(value = "0", message = "payStatus参数值不能少于0", groups = {create.class, update.class})
    private Integer payStatus;

    @NotNull(message = "payWay参数缺失", groups = {create.class, update.class})
    @DecimalMin(value = "0", message = "payWay参数值不能少于0", groups = {create.class, update.class})
    private Integer payWay;

    @NotNull(message = "payTime参数缺失", groups = {create.class, update.class})
    @DecimalMin(value = "0", message = "payTime参数值不能少于0", groups = {create.class, update.class})
    private Long payTime;

    @NotNull(message = "totalAmount参数缺失", groups = {create.class, update.class})
    private BigDecimal totalAmount;

    @NotNull(message = "orderAmount参数缺失", groups = {create.class, update.class})
    private BigDecimal orderAmount;

    @NotNull(message = "refundStatus参数缺失", groups = {create.class, update.class})
    @DecimalMin(value = "0", message = "refundStatus参数值不能少于0", groups = {create.class, update.class})
    private Integer refundStatus;

    @NotNull(message = "cancelTime参数缺失", groups = {create.class, update.class})
    @DecimalMin(value = "0", message = "cancelTime参数值不能少于0", groups = {create.class, update.class})
    private Long cancelTime;

    @NotNull(message = "refundTime参数缺失", groups = {create.class, update.class})
    @DecimalMin(value = "0", message = "refundTime参数值不能少于0", groups = {create.class, update.class})
    private Long refundTime;

//    @NotNull(message = "shopRemark参数缺失", groups = {create.class, update.class, change.class})
    @Length(max = 64, message = "shopRemark参数不能超出64个字符", groups = {create.class, update.class, change.class})
    private String shopRemark;

}
